package com.demo.mq.activemq.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.demo.mq.activemq.service.MQConsumerService;
import com.demo.mq.activemq.service.MQProducerService;

/**
 * @author lee9213@163.com
 * @version 1.0
 * @date 2017/3/13 18:16
 */
@RestController
public class MQController {

    @Autowired
    private MQProducerService producerService;

    @Autowired
    private MQConsumerService consumerService;

    @RequestMapping("/send")
    public String send(String text){
        producerService.send(text);
        return "send";
    }

    @RequestMapping("/receive")
    public String receive(){
        String str = consumerService.receive();
        return str;
    }
}
